using AutoMapper;
using Pay.DTO;
using Pay.Data;
using Pay.IService;
using Pay.Core;

namespace Pay.Service.AutoMapper
{
    public class UserInvitationHisMapper : IStartupDto
    {
        private IMapperConfigurationExpression _cfg;
        public UserInvitationHisMapper(IMapperConfigurationExpression cfg)
        {
            _cfg = cfg;
        }
        public void Execute()
        {
            Create();
        }
        protected virtual void Create()
        {
            _cfg.CreateMap<UserInvitationHis, user_invitation_his_dto>()
                .ForMember(dest => dest.id, src => src.MapFrom(c => c.Id))
                .ForMember(dest => dest.user_id, src => src.MapFrom(c => c.UserId))
                .ForMember(dest => dest.invited_user_id, src => src.MapFrom(c => c.InvitedUserId))
                .ForMember(dest => dest.invitation_code, src => src.MapFrom(c => c.InvitationCode))
                .ForMember(dest => dest.create_time, src => src.MapFrom(c => c.CreateTime))
                .ForMember(dest => dest.merchant, src => src.MapFrom(c => c.Merchant));


        }
    }
}
